<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp"%>


<div class="pageContent">
<form method="post" id="sysPersonalForm" enctype="multipart/form-data" action="${ctx}/sysPersonal/save" class="pageForm required-validate" onsubmit="return iframeCallback(this,navTabAjaxDone);">
	<input type="hidden" name="id" value="${user.id}"/>
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="sysPersonal:edit">
			<li><a class="save" href="#" onclick="hrefSave_OnClick('sysPersonalForm')"><span>保存</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
		<div class="pageFormContent" layoutH="56">
			<dl>
				<dt>用户名：</dt>
				<dd>
					<input type="text" value="${user.userName}" maxlength="20" readonly="readonly" style="border: none;"/>
				</dd>
			</dl>
			<dl>
				<dt>姓名：</dt>
				<dd>
					<input type="text" value="${user.trueName}" maxlength="20" readonly="readonly" style="border: none;"/>
				</dd>
			</dl>
			<dl>
				<dt>员工编号：</dt>
				<dd>
					<input type="text" value="${user.serils}" maxlength="20" readonly="readonly" style="border: none;"/>
				</dd>
			</dl>
			<dl>
				<dt>所属部门：</dt>
				<dd>
					<input type="text" value="${user.departmentName}" maxlength="20" readonly="readonly" style="border: none;"/>
				</dd>
			</dl>
			<dl>
				<dt>所属角色：</dt>
				<dd>
					<input type="text" value="${sysRoleName}" maxlength="20" readonly="readonly" style="border: none;"/>
				</dd>
			</dl>
			<dl>
				<dt>是否允许登陆</dt>
					<dd>
						<input type="text" value="${user.isValid eq '0' ? '允许' : '禁用'}" maxlength="20" readonly="readonly" style="border: none;"/>
					</dd>
				</dl>
			<dl>
				<dt>电话：</dt>
				<dd>
					<input type="text" name="mobilePhone" value="${user.mobilePhone}" maxlength="20"/>
				</dd>
			</dl>		
			<dl>
				<dt>邮箱：</dt>
				<dd>
					<input type="text" name="email" value="${user.email}" maxlength="20"/>
				</dd>
			</dl>
			<dl class="nowrap">
				<dt>头像：</dt>
				<dd>
					<input name="file1" type="file" />
				</dd>
			</dl>
			<dl class="nowrap">
				<dt>&nbsp;</dt>
				<dt>
				   <c:if test="${user.picture != '' && user.picture != null}">
				        <img src="${ctx}${user.picture}" width="90" height="90"/>
				   </c:if>
				</dt>
			</dl>		
		</div>
	</form>
</div>

<script>
$("input[name='file1']").change(function(){
	custom_Validate();
});
function custom_Validate()
{
	var ids = "";
	var result = 0;
	
	$("input[name='file1']").each(function(){
		if (!/\.(gif|jpg|jpeg|png|bmp|GIF|JPG|PNG|BMP)$/.test(document.getElementsByName("file1")[0].value) && document.getElementsByName("file1")[0].value != "") {
		 	art.dialog({
				icon : 'error',
				content : '图片类型必须是.gif,jpeg,jpg,png,bmg中的一种',
				time : 2
			});
		 	ths.value = "";
		 	result = 1;
		 	return false;
		}
		return true;
	});
	if(result == 0)
	{
		return true;
	}else
	{
		return false;
	}
}
</script>


